<!DOCTYPE html>
<html>
<head>
    <title>{$user_login} - 个人中心</title>
    <meta name="keywords" content=""/>
    <meta name="description" content="">
    <include file="public@head"/>
    <style>
        .control-label {
            font-weight: bold;
            float: left;
            width: 70px;
        }
    </style>
</head>
<body class="body-white" id="top">
<include file="public@nav"/>
<div class="container tc-main">
    <div class="row">
        <div class="col-md-3">
            <include file="public@usernav"/>
        </div>
        <div class="col-md-9">
            <div class="tabs">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#one"><i class="fa fa-home"></i> 赛事介绍</a></li>
                </ul>
                <if condition="empty($contest)">
                    <h4>暂时没有比赛</h4>
                <else/>
                    <div class="tab-content">
                    <div class="tab-pane active" id="one">
                        <br>
                        <div class="form-group">
                            <label>赛事标题</label>
                            <h4>{$contest.title}</h4>
                        </div>
                        <div class="form-group">
                            <label>赛事标题</label><br />
                            <foreach name="categories" index="key" item="vo">
                                <a class="label label-default" style="background-color: #a7a2a2;border-radius: 5px;text-decoration:none;" data-toggle="tab">{$vo.name}</a>
                            </foreach>
                        </div>
                        <div class="form-group">
                            <label>报名时间</label><br />
                            <span>{:date('Y-m-d',$contest.apple_start)} - {:date('Y-m-d',$contest.apple_end)}</span>
                        </div>
                        <div class="form-group">
                            <label>评分时间</label><br />
                            <span>{:date('Y-m-d',$contest.review_start)} - {:date('Y-m-d',$contest.review_end)}</span>
                        </div>
                        <div class="form-group">
                            <label>赛事介绍</label><br />
                            <span>{:htmlspecialchars_decode($contest.desc)}</span>
                        </div>
                    </div>
                </div>
                </if>
            </div>
        </div>
    </div>
</div>
<include file="public@footer"/>
<!-- /container -->
<include file="public@scripts"/>
</body>
<script src="__STATIC__/js/admin.js"></script>
<script>
    function reviewScore($id) {
        openIframeLayer("{:url('Works/reviewWindow')}?id=" + $id, '请输入分数', {
            area: ['600px', '300px'],
            btn: ['确定', '取消'],
            yes: function (index, layero) {
                //do something

                var iframeWin = window[layero.find('iframe')[0]['name']];
                var works = iframeWin.confirm();
                console.log(works);
                if (works.score.length == 0) {
                    layer.msg('请输入分数');
                    return;
                }
                $.ajax({
                    url: 'reviewPost',
                    type: 'post',
                    data: works,
                    dataType: 'JSON',
                    success: function (data) {
                        if (data.code == '1') {
                            noty({
                                text: data.msg,
                                type: 'success',
                                layout: 'topCenter',
                                modal: true,
                                timeout: 800,
                                callback: {
                                    afterClose: function () {
                                        if (data.url) {
                                            //返回带跳转地址
                                            window.location.href = data.url;
                                        } else {
                                            //刷新当前页
                                            reloadPage(window);
                                        }
                                    }
                                }
                            }).show();

                        } else if (data.code == '0') {
                            //art.dialog.alert(data.info);
                            //alert(data.info);//暂时处理方案
                            art.dialog({
                                content: data.msg,
                                icon: 'warning',
                                ok: function () {
                                    this.title(data.msg);
                                    return true;
                                }
                            });
                        }
                    }
                });
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }
</script>
</html>